function t(t) {
    return (t = t.toString())[1] ? t : "0" + t;
}

module.exports = {
    formatTime: function(e) {
        var n = e.getFullYear(), u = e.getMonth() + 1, r = e.getDate(), o = e.getHours(), i = e.getMinutes(), a = e.getSeconds();
        return [ n, u, r ].map(t).join("/") + " " + [ o, i, a ].map(t).join(":");
    },
    htpUrl: "https://www.yunzmall.com/min_img",
    formatTimeTwo: function(e, n) {
        var u = [ "Y", "M", "D", "h", "m", "s" ], r = [], o = new Date(1e3 * e);
        for (var i in r.push(o.getFullYear()), r.push(t(o.getMonth() + 1)), r.push(t(o.getDate())), 
        r.push(t(o.getHours())), r.push(t(o.getMinutes())), r.push(t(o.getSeconds())), r) n = n.replace(u[i], r[i]);
        return n;
    },
    formatTimes: function(e) {
        var n = e.getFullYear(), u = e.getMonth() + 1, r = e.getDate();
        return e.getHours(), e.getMinutes(), e.getSeconds(), [ n, u, r ].map(t).join("-");
    },
    debounce: function(t, e) {
        var n, u = e || 1e3;
        return function() {
            clearTimeout(n);
            var e = this, r = arguments;
            n = setTimeout(function() {
                t.call(e, r);
            }, u);
        };
    },
    throttle: function(t, e) {
        var n = 0, u = e || 200, r = null;
        return function() {
            var o = arguments, i = this, a = new Date();
            a - n > u ? (r && clearTimeout(r), r = setTimeout(function() {
                n = a, t.call(i, o);
            }, e)) : (n = a, t.call(i, arguments));
        };
    }
};